.TH std::experimental::ranges::distance 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::ranges::distance \- std::experimental::ranges::distance

.SH Synopsis
   Defined in header <experimental/ranges/iterator>
   namespace {
                                                                         (ranges TS)
       constexpr /* unspecified */ distance = /* unspecified */;         (customization
                                                                         point object)
   }
   Call signature
   template< Iterator I, Sentinel<I> S >
   constexpr ranges::difference_type_t<I> distance( I first, S last  \fB(1)\fP
   );
   template< Range R >
   constexpr ranges::difference_type_t<ranges::iterator_t<R>>        \fB(2)\fP
   distance( R&& r );
   template< SizedRange R >
   constexpr ranges::difference_type_t<ranges::iterator_t<R>>        \fB(3)\fP
   distance( R&& r );

   Returns the distance between first and last, or between the beginning and the end of
   the range r.

   1) If SizedSentinel<S, I> is satisfied, equivalent to return last - first;.
   Otherwise, returns the number of increments needed to get from first to last. If
   [first, last) does not denote a range, then I and S must be the same type and must
   model SizedSentinel, and [last, first) must denote a range. Otherwise, the behavior
   is undefined.
   2) Equivalent to return ranges::distance(ranges::begin(r), ranges::end(r));.
   3) Equivalent to return ranges::size(r);.

   Instantiating overloads (2,3) may be ill-formed if the header
   <experimental/ranges/range> is not included before the point of instantiation.

.SH Return value

   The distance between first and last, or between the beginning and the end of the
   range r.

.SH Example

    This section is incomplete
    Reason: no example

.SH See also

   distance returns the distance between two iterators
            \fI(function template)\fP
   advance  advances an iterator by given distance
            \fI(function template)\fP
   next     increment an iterator
            \fI(function template)\fP
   prev     decrement an iterator
            \fI(function template)\fP
   size     obtains the size of a range whose size can be calculated in constant time
            (customization point object)

.SH Category:
     * Todo no example
